<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
			$(function(){
				$("form[name=myForm]").submit(function(){
					return Verify();
				});
			});
			function Verify () {
				
				var bool=true;
				if($("input[name=title]").val() == ""){
					alert("请填写标题");
					bool=false;
				}
				return bool;
			}
		</script>
<style type="text/css">
#show {
	width: 700px;
	height: 500px;
	margin: 0px auto;
	text-align: center;
}

#show table {
	width: 650px;
	margin: 0px auto;
}

#show table tr td:nth-last-child(1) {
	text-align: left;
}

a {
	display: inline-block;
	text-decoration: none;
	color: black;
	background-color: #E1E1E1;
	font-size: 13px;
	border: 1px solid #ADADAD;
	padding: 0px 5px 0px 5px;
}
</style>
</head>
<body>
	<div id="show">
		<form action="Update" method="post" name="myForm">
			<table border="" cellspacing="" cellpadding="">
				<tr>
					<td colspan="2" style="font-size: 32; text-align: center;">新闻列表</td>
				</tr>
				<tr>
					<td>新闻编号</td>
					<td>${detail.id}</td>
				</tr>
				<tr>
					<td>新闻分类</td>
					<td><select name="classify">
							<option value="0">全部</option>
							<c:forEach var="categorie" items="${categories}">
								<c:choose>
									<c:when test="${categorie.id} == ${detail.news_Category.id}">
										<option selected="selected" value="${categorie.id}">${categorie.name }</option>
									</c:when>
									<c:otherwise>
										<option value="${categorie.id}">${categorie.name }</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
					</select></td>
				</tr>
				<tr>
					<td>新闻标题(*)</td>
					<td><input type="text" name="title" value="${detail.title}" /></td>
				</tr>
				<tr>
					<td>新闻摘要</td>
					<td><textarea name="abstract">${detail.summary}</textarea></td>
				</tr>
				<tr>
					<td>作者</td>
					<td><input type="text" id="author" value="${detail.author}" /></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;">
						<input type="submit" id="su" value="提交" /> 
						<input type="hidden" name="did"  value="${detail.id}" />
						<a href="Initialize">返回</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
